package com.framework.yhbapi.controller;

import com.framework.exception.util.RespResult;
import com.framework.service.yhbservice.YhbNoticeService;
import com.framework.yhbEntity.notice.YhbNotice;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 功能描述: 通知控制器
 *
 * @author ck
 * @date 2018/10/22 13:46
 */
@RestController
@RequestMapping(value = "yhbNotice")
@Api(value = "通知模块",tags = {"通知模块"})
public class YhbNoticeController {

	@Autowired
	private YhbNoticeService yhbNoticeService;

	@GetMapping("/user/getNoticeList")
	@ApiOperation("通知列表")
	@ApiImplicitParams({
			@ApiImplicitParam(name="token",value="登录产生的token",dataType="String", paramType = "query",required = true)
	})
	public RespResult getNoticeList(String token){
		List<YhbNotice> list=yhbNoticeService.getNoticeList(token);
		return RespResult.ok().put("noticeList",list);
	}


}
